﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web;

/// <summary>
/// Summary description for ProModify
/// </summary>
public class ProModify
{
	public ProModify()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    //false : can't insert or insert error.
    //true: Insert successful
    public Boolean EditAccount(UserInfo ui)
    {
        Boolean bResult = false;
        ConnectDB db = new ConnectDB();
        bResult = db.editUser(ui);

        return bResult;
    }

    public DataSet LoadDepartment()
    {
        ConnectDB db = new ConnectDB();
        DataSet ds = new DataSet();
        ds = db.getListDepartment();
        return ds;
    }

    public DataSet LoadPosition()
    {
        ConnectDB db = new ConnectDB();
        DataSet ds = new DataSet();
        ds = db.getListPosition();
        return ds;
    }

    public DataSet LoadUser(string user)
    {
        ConnectDB db = new ConnectDB();
        DataSet ds = new DataSet();
        ds = db.isExistUser(user);
        return ds;
    }

    //public Boolean KiemtraDungLuong() 
    //{
    //    if(FileUploadControl.HasFile)
    //{
    //    try
    //    {
    //        if(FileUploadControl.PostedFile.ContentType == "image/jpeg")
    //        {
    //            if(FileUploadControl.PostedFile.ContentLength < 102400)
    //            {
    //                string filename = Path.GetFileName(FileUploadControl.FileName);
    //                FileUploadControl.SaveAs(Server.MapPath("~/") + filename);
    //                StatusLabel.Text = "Upload status: File uploaded!";
    //            }
    //            else
    //                StatusLabel.Text = "Upload status: The file has to be less than 100 kb!";
    //        }
    //        else
    //            StatusLabel.Text = "Upload status: Only JPEG files are accepted!";
    //    }
    //    catch(Exception ex)
    //    {
    //        Sta
    //}

    //sql

}
